import http from "@/utils/http";
//获取公共数据 如检索框、表单下拉列表数据
export const getCommonData = (params) => {
  return http.get("/cfg/getCategory", params);
};
//删除已上传的单个文件
export const delUploadFile = (id) => {
  return http.get("/commonFile/deleteFile", { fileId: id });
};
//下载文件
export const download = (id) => {
  return http.get(
    "/commonFile/download",
    { fileId: id },
    {
      responseType: "blob",
    }
  );
};
//根据姓名搜索人员列表
export const getPersonList = (params) => {
  return http.post("/kyry/personDetails", params);
};
//获取科研人员详情
export const getPersonDetail = (params) => {
  return http.post("/kyry/personDetailsView", params);
};
//获取专家详情
export const getExpertDetail = (params) => {
  return http.post("/zjrc/selectExpertDetails", params);
};
//根据字典名称查询字典值列表
export const getDictByType = (params) => {
  return http.get("/system/dict/data/list", params);
};
//用户撤销流程
export const cancelProcess = (id) => {
  return http.del("/flowable/instance/cancel-by-start-user", { id });
};

//获取导出字段
export const exportFields = (params) => {
  return http.get("/commonFile/getExportStr", params);
};

//下载public目录下模板文件
export const getTemplate = (fileName) => {
  return http.get(`/template/${fileName}`, null, {
    baseURL: "",
    responseType: "blob",
  });
};
